package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.pojo.BusinessRulesPoJo;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/12/28 16:49
 * @desrcption:
 */
@Getter
@Setter
@ToString
public class InactiveRuleDTO extends BaseDTO {


    private static final long serialVersionUID = 621709528482658156L;
    /**
     * 规则
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<BusinessRulesPoJo> ruleList;


    /**
     * 数据
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private PaasFormDataEntity paasFormDataEntity;


    /**
     * 字段列表
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<FieldAttrEntity> explainList;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long dataId;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessType;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer saasMark;
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessRuleSize;

    @Getter(onMethod_ = {@QueryIgnore})
    private Long businessRuleInfoId;

    /**
     * 是否是从导入过来的
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer isImport;

    public InactiveRuleDTO() {
    }

    public InactiveRuleDTO(List<BusinessRulesPoJo> ruleList, PaasFormDataEntity paasFormDataEntity,
                           List<FieldAttrEntity> explainList, Long dataId, Integer businessType, Integer saasMark, String corpid, UserVO userVO,
                           String platform, String httpHeader, String browserInfo, String ip, String locale, Integer isImport) {
        this.ruleList = ruleList;
        this.paasFormDataEntity = paasFormDataEntity;
        this.explainList = explainList;
        this.dataId = dataId;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.isImport = isImport;
        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
        setHttpHeader(httpHeader);
        setBrowserInfo(browserInfo);
        setIp(ip);
        setLocale(locale);
    }
}
